#pragma once

#include <vector>
#include <tbb/scalable_allocator.h>

#include "TcpConnection.h"


/// Helper typedefs
typedef void (TcpConnection::*ConnectionCallback)();
typedef std::pair<TcpConnection *, ConnectionCallback> Delegate;


/// Vector of delegates executing works
class WorksVector : public std::vector<Delegate, tbb::scalable_allocator<Delegate> >
{
public:
	/// Allocates memory for this class using scalable_allocator
	void *operator new(size_t blockSize)
	{
		return scalable_malloc(blockSize);
	}

	/// Deallocates memory of this class using scalable_allocator
	void operator delete(void *pointer)
	{
		scalable_free(pointer);
	}
};